package com.example.androidlearning.sy4;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;

import com.example.androidlearning.R;

public class ListView01 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.listview);

        ListView listViewText = findViewById(R.id.listview02);
        ListView listViewCheck = findViewById(R.id.listview03);

        String[] arr = {"android疯狂讲义", "java核心技术"};

        ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, R.layout.listview_arry_item, arr);

        listViewText.setAdapter(arrayAdapter);


        String[] arrCheck = {"Java","Hibernate"};
        ArrayAdapter<String> checkAdapter = new ArrayAdapter<String>(this, R.layout.listview_checked_item, arrCheck);
        listViewCheck.setAdapter(checkAdapter);

        init();
        setListeners();
    }

    void init(){

    }

    void setListeners(){

    }

}
